/*
 *英才会硕信息科技有限公司拥有本软件的版权，拥有本软件版权2025   并保留所有权利。
 *Copyright 2021,YCHS Information&Science Technology Co.,Ltd,
 *All rights reserved.
 */
package com.ychs.lawyerback01.dto;

/**
 * @author xuehongjin
 * @version 1.0
 * @date 2025/8/11
 */
public class PageDTO {
    //接受的页码，第几页
    private Integer page;
    //一页多少条
    private Integer pageSize;

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getStart() {
        // 设置默认值，而不是抛出异常
        int currentPage = (this.page == null || this.page <= 0) ? 1 : this.page;
        int currentPageSize = (this.pageSize == null || this.pageSize <= 0) ? 10 : this.pageSize;

        return (currentPage - 1) * currentPageSize;
    }

    //sql语句从第几条开始
    private Integer start;
}